///////////////// handy constants and definitions

#define MSGSIZE		29
#define STEER		128

/*********************** LEDs ********************/
// enum and defines for LEDs, active low
enum{ON, OFF};
#define ledRed		PORTBbits.RB5
#define ledYel		PORTBbits.RB7
#define ledGrn		PORTBbits.RB6


/*********************** timer ********************/
//#define timer_offset 	65286  	//timer offset for 0.05 ms interrupt
#define timer_offset 65015  //offset for 0.1045 ms interrupt

#define SRVODLY   400       // ~40 ms delay to repeat servo pulse train

/*********************** motor ********************/
// Port C output constants for PWM
// drive motor is on C0/C2
// steering motor is on C4/C5

#define	FORWARD		0x01	// 0000 0001
#define	REVERSE		0x04	// 0000 0100
#define STOP		0x00	// 0000 0000
	
#define LEFT		0x20	// 0010 0000
#define RIGHT		0x10	// 0001 0000
#define CENTER		0x00	// 0000 0000

/*********************** gripper servo ********************/

#define GRIPPER     PORTCbits.RC1
#define HAND_OPEN   14
#define HAND_CLOSE  7